﻿@{
    Layout = null;
}
@model ElingOA6_Admin_DSJCJ.Areas.Admin.Models.DocumentPubEditViewModel
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>信息发布</title>
    @Html.Partial("LoadPanelPartial")
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
        <script src="../../../../Scripts/json2.js" type="text/javascript"></script>  
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery-ui-tabs.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery-ui.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Fckeditor/fckeditor.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/CJL.0.1.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/ImagePreview.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/ntko.js", true)" type="text/javascript"></script>

    <script type="text/javascript" src="@Url.Content("~/Scripts/SWFUpload/js/swfupload.js", true)"></script>

    <script type="text/javascript" src="@Url.Content("~/Scripts/SWFUpload/js/documentpub_handlers.js", true)"></script>

    @Html.DevExpress().GetStyleSheets(

    new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
    )
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
    )
    <style type="text/css">
         #txtFNote{
             height:170px
         }
        #swfu_container li
         {
             width:120px;
             float:left;
             margin-left:5px;
             position:relative;
          }
         #swfu_container li .delbutton
          {
              float:left;             
              position:absolute; right:0; top:0;
              cursor:pointer;
          }
          #pic_list1 li
         {
             width:120px;
             float:left;
             margin-left:5px;
             position:relative;
          }
         #pic_list1 li .delbutton
          {
              float:left;             
              position:absolute; right:0; top:0;
              cursor:pointer;
          }
          
     </style>

    <script>

        /*全局变量*/
        $(document).ready(function () {
            //查看控制权限
            $("#tabs").tabs();
            if ($('#hdShowLookTab').val() == "Y") {
                $('#tabs').css("display", "block");
            }
            else {
                $('#tabs').css("display", "none");
            }

            //绑定权限
            addRowBm_table('Look');
            addRowGZZ_table('Look');
            addRowGW_table('Look');
            addGroup('Look');
            addUser('Look');


            $("#toolMenu").smartFloat();

            var opMethod = $("#hdMethod").val();
            if (opMethod == "EDIT") {//修改
                var clientrdEditModeObj = ASPxClientRadioButtonList.Cast("rdEditMode");
                var editModeValue = clientrdEditModeObj.GetValue();
                if (editModeValue == "0") {
                    //HTML

                }
                else {
                    //office
                    var url = $("#hdUrl").val();
                    var newofficetype = $("#hdNewofficetype").val();
                    editoffice(url, newofficetype);
                }
                //附件
                var attachList = $("#hdAttachJsonString").val();
                if (attachList != "") {
                    attachList = JSON.parse(attachList);
                }
                else {
                    attachList = null;
                }
                if (attachList != null) {
                    for (var i = 0; i < attachList.length; i++) {

                        $("#tableOldAttach").append("<tr id='trOldAttach" + i + "'><td> <a href='###' style='color:Red; font-size:12px' onclick='delOldFile(\"" + attachList[i].attachID + "\"," + i + ")' >[删除]</a>"
                    + "&nbsp;&nbsp;&nbsp;<a  target='_blank' href='" + attachList[i].atthref + "' font-size:12px' >" + attachList[i].title + "</a>"
                    + "&nbsp;&nbsp;&nbsp;" + attachList[i].desc
                    + "</td></tr>");
                    }
                }
                //通知对象
                addRecObject();
                //信息合发部门
                addJoinDeptUser();
                //信息文档呈送
                addDocReference();
            }
            else {
                //FDocTemplate_ValueChanged();
                $("#imgLogo").css("display", "none");
            }
        });
        /*删除现有文件*/
        function delOldFile(attachID, rowIndex) {
            if (confirm("确定删除该附件吗？")) {
                $.ajax({
                    type: "POST",
                    url: rootPath + "/Admin/DocumentPub/DeleteDocAttach",
                    data: { attachID: attachID },
                    async: true,
                    success: function (jsonstr) {
                        var msg = jsonstr.split('|');
                        if (msg[0] == "SUCCESS") {
                            alert("删除成功");
                            $("tr[id='trOldAttach" + rowIndex + "']").remove(); //删除当前行
                        }
                        else {
                            if (msg.length > 1) {
                                alert(msg[1]);
                            }
                        }
                    }
                });
            }
        }
        function getDefaultValue() {
            if ($("#hdWaterMarkType").val() != "") {
                if ($("#hdWaterMarkType").val() == "1") {
                    return "V2"; //图片
                }
                else {

                    return "V1"; //文本
                }
            }
            else {
                return "";
            }
        }
        /*编辑模式改变*/
        function rdEditMode_ValueChanged(s, e, isInit) {
            if ($("#hdDocClsCd").val() != "") {
                var clientrdEditModeObj = ASPxClientRadioButtonList.Cast(s);
                var editModeValue = clientrdEditModeObj.GetValue();
                var editModeType = "O";
                switch (editModeValue) {
                    case "0":
                        {
                            //HTML

                            $("#divOffictControl").css("display", "none");
                            $("#divFck").css("display", "block");
                            var oFCKeditor = new FCKeditor('fck1');
                            oFCKeditor.BasePath = rootPath + "/Fckeditor/";
                            oFCKeditor.ToolbarSet = "Video";
                            oFCKeditor.Height = 400;

                            //oFCKeditor.DocClsCd1 = '0101';
                            //            oFCKeditor.DlgImgWidth = 600;
                            oFCKeditor.ReplaceTextarea();

                            editModeType = "H";

                            break;
                        }
                    case "1":
                        {
                            //WORD
                            $("#divOffictControl").css("display", "block");
                            $("#divFck").css("display", "none");

                            break;
                        }
                    case "2":
                        {
                            //EXCEL
                            $("#divOffictControl").css("display", "block");
                            $("#divFck").css("display", "none");


                            break;
                        }
                    case "3":
                        {
                            //PPT
                            $("#divOffictControl").css("display", "block");
                            $("#divFck").css("display", "none");


                            break;
                        }
                }
                var clientFDocTemplateObj = ASPxClientComboBox.Cast("FDocTemplate");
                var templateDefaultValue = $("#hdTemplateDefaultValue").val();
                $("#hdTemplateDefaultValue").val("");
                //绑定模板下拉数据
                $.ajax({
                    type: "GET",
                    url: rootPath + "/Admin/DocumentPub/GetTemplateString",
                    ansyc: false,
                    data: "docClsCd=" + $("#hdDocClsCd").val() + "&editMode=" + editModeType,
                    success: function (result) {
                        clientFDocTemplateObj.ClearItems();
                        if (result != "") {
                            var modelList = JSON.parse(result);

                            var isDefault = false;
                            for (var i = 0; i < modelList.length; i++) {
                                clientFDocTemplateObj.AddItem(modelList[i].Text, modelList[i].Value, "");
                                if (templateDefaultValue != "" && templateDefaultValue == modelList[i].Value) {
                                    isDefault = true;
                                }

                            }
                            if (isDefault == true) {
                                clientFDocTemplateObj.SetValue(templateDefaultValue);
                            }
                            else {
                                clientFDocTemplateObj.SetValue("-1");
                            }
                            var opMethod = $("#hdMethod").val();
                            if (opMethod != "EDIT") {//新增
                                FDocTemplate_ValueChanged();
                            }
                            else {
                                if (isInit != 'Y') {
                                    switch (editModeValue) {
                                        case "0":
                                            {
                                                //HTML


                                                break;
                                            }
                                        case "1":
                                            {
                                                //WORD

                                                editoffice("", "1");

                                                break;
                                            }
                                        case "2":
                                            {
                                                //EXCEL

                                                editoffice("", "2");

                                                break;
                                            }
                                        case "3":
                                            {
                                                //PPT

                                                editoffice("", "3");

                                                break;
                                            }
                                    }
                                }
                            }
                        }
                        //                        else {
                        //                            switch (editModeValue) {
                        //                                case "0":
                        //                                    {
                        //                                        //HTML


                        //                                        break;
                        //                                    }
                        //                                case "1":
                        //                                    {
                        //                                        //WORD

                        //                                        editoffice("", "1");

                        //                                        break;
                        //                                    }
                        //                                case "2":
                        //                                    {
                        //                                        //EXCEL

                        //                                        editoffice("", "2");

                        //                                        break;
                        //                                    }
                        //                                case "3":
                        //                                    {
                        //                                        //PPT

                        //                                        editoffice("", "3");

                        //                                        break;
                        //                                    }
                        //                            }
                        //                        }

                    }
                });
            }

        }


        /*模板选择改变*/
        function FDocTemplate_ValueChanged() {
            var clientFDocTemplateObj = ASPxClientComboBox.Cast("FDocTemplate");
            var clientrdEditModeObj = ASPxClientRadioButtonList.Cast("rdEditMode");
            var editModeValue = clientrdEditModeObj.GetValue();
            var templateName = clientFDocTemplateObj.GetValue();
            if (templateName == "-1") {
                switch (editModeValue) {
                    case "0":
                        {
                            //HTML
                            if (typeof (FCKeditorAPI) != "undefined") {
                                var oFCKeditor = FCKeditorAPI.GetInstance("fck1");

                                oFCKeditor.SetHTML("");
                            }
                            break;
                        }
                    case "1":
                        {
                            //WORD
                            editoffice("", "1");
                            break;
                        }
                    case "2":
                        {
                            //EXCEL
                            editoffice("", "2");
                            break;
                        }
                    case "3":
                        {
                            //PPT
                            editoffice("", "3");
                            break;
                        }
                }
            }
            else {
                if (templateName != "" && templateName != null) {
                    switch (editModeValue) {
                        case "0":
                            {
                                $.ajax({
                                    type: "GET",
                                    ansyc: false,
                                    url: rootPath + "/Admin/DocumentPub/GetTemplateHtml",
                                    data: "templateID=" + templateName,
                                    success: function (result) {
                                        if (typeof (FCKeditorAPI) != "undefined") {
                                            var oEditor = FCKeditorAPI.GetInstance("fck1");
                                            if (oEditor.EditingArea) {
                                                oEditor.SetHTML(result);
                                            }
                                        }

                                    }
                                });
                                break;
                            }
                        default:
                            {
                                $("#divOffictControl").css("display", "block");
                                var url = templateName;
                                var str = "";
                                var t = templateName.lastIndexOf(".");
                                if (t != -1) {
                                    var officename = templateName.substring(t + 1, templateName.length);
                                    switch (officename) {
                                        case "doc":
                                        case "docx":
                                            {
                                                clientrdEditModeObj.SetValue("1");
                                                editoffice(url, "1");
                                                break;
                                            }
                                        case "xls":
                                        case "xlsx":
                                            {
                                                clientrdEditModeObj.SetValue("2");
                                                editoffice(url, "2");
                                                break;
                                            }
                                        case "ppt":
                                        case "pptx":
                                            {
                                                clientrdEditModeObj.SetValue("3");
                                                editoffice(url, "3");
                                                break;
                                            }
                                    }
                                }
                                break;
                            }
                    }
                }
            }
        }
        function rdPubDept_ValueChanged(s, e) {
            var clientrdPubDeptObj = ASPxClientRadioButtonList.Cast(s);
            var clientcboPubDeptObj = ASPxClientComboBox.Cast("cboPubDept");
            var clientcboPubWorkGroupObj = ASPxClientComboBox.Cast("cboPubWorkGroup");
            var clienttxtChooseJoinDeptUserObj = ASPxClientButtonEdit.Cast("txtChooseJoinDeptUser");
            if (clientrdPubDeptObj.GetValue() == "0") {
                //部门
                clientcboPubDeptObj.SetVisible(true);
                clientcboPubWorkGroupObj.SetVisible(false);
                clienttxtChooseJoinDeptUserObj.SetEnabled(true);
            }
            else {
                //工作组
                clientcboPubDeptObj.SetVisible(false);
                clientcboPubWorkGroupObj.SetVisible(true);
                clienttxtChooseJoinDeptUserObj.SetText("");
                $("#hdSelJoinDeptUserKeys").val("");
                clienttxtChooseJoinDeptUserObj.SetEnabled(false);
            }
        }
        /*增加上传附件控件*/
        function addFileControl(rowIndex) {
            var trLenth = $("#tableAttach tr[name='trAttach']").length;
            var lastTrId = $("#tableAttach tr[name='trAttach']")[trLenth - 1].id;
            if (lastTrId == "trAttach" + rowIndex) {
                rowIndex = rowIndex + 1;
                var uploadCtl = $("#hdUploadCtl").val();
                uploadCtl = uploadCtl.replace("addFileControl(_index_)", "addFileControl(" + rowIndex + ")");
                uploadCtl = uploadCtl.replace(new RegExp("uploadName", "gm"), "uploadName" + rowIndex);
                $("#tableAttach").append("<tr name='trAttach' id='trAttach" + rowIndex + "'>"
                                + "<td style='width: 10%; text-align:right'><a href='###' style='color:Red; font-size:12px' onclick='delFileControl(" + rowIndex + ")'>[删除]</a></td> "
                                + "<td style='width:30%'>" + uploadCtl + "</td>"
                //+ "<input type='file' id='fileUpload" + rowIndex + "'  name='attachUpload' onchange='addFileControl(" + rowIndex + ")'/>"
                                + "<td style='width:60%'>说明<input type='text' name='fileDesc' style='width:70%' />"
                                + "</td></tr>");
            }
        }
        /*删除上传附件控件*/
        function delFileControl(rowIndex) {
            var trLenth = $("#tableAttach tr[name='trAttach']").length;
            if (trLenth == 1) {
                //最后一行
                $("tr[id='trAttach" + rowIndex + "']").remove(); //删除当前行
                var uploadCtl = $("#hdUploadCtl").val();
                uploadCtl = uploadCtl.replace("addFileControl(_index_)", "addFileControl(1)");
                uploadCtl = uploadCtl.replace(new RegExp("uploadName", "gm"), "uploadName1");

                $("#tableAttach").append("<tr id='trAttach1' name='trAttach'>"
                                + "<td style='width: 10%; text-align:right'><a href='###' style='color:Red; font-size:12px' onclick='delFileControl(1)'>[删除]</a></td> "
                                 + "<td style='width:30%'>" + uploadCtl + "</td>"
                //+ "<input type='file' id='fileUpload1' name='attachUpload' onchange='addFileControl(1)' />"
                                + "<td style='width:60%'>说明<input type='text'  name='fileDesc' style='width:70%' />"
                                + "</td></tr>");
            }
            else {
                $("tr[id='trAttach" + rowIndex + "']").remove(); //删除当前行
            }
        }
        /*初始化设置通知对象*/
        function addRecObject() {
            var clienttxtUserObj = ASPxClientButtonEdit.Cast("txtChooseUser");
            var returnValue = $("#hdSelRecObjectKeys").val();
            if (returnValue != "") {
                var list = JSON.parse(returnValue);
                var treeModelList = list[0];
                var userString = "";
                if (treeModelList.length > 0) {
                    userString += "部门人员:";
                    for (var i = 0; i < treeModelList.length; i++) {
                        userString += treeModelList[i].Text + ",";
                    }
                    userString = userString.substr(0, userString.lastIndexOf(','));
                    userString += ";";
                }
                treeModelList = list[1];
                if (treeModelList.length > 0) {
                    userString += "工作组人员:";
                    for (var i = 0; i < treeModelList.length; i++) {
                        userString += treeModelList[i].Text + ",";
                    }
                    userString = userString.substr(0, userString.lastIndexOf(','));
                }
                clienttxtUserObj.SetValue(userString);
            }
            else {
                clienttxtUserObj.SetValue("");
            }
        }
        /*选择通知对象*/
        function chooseRecObject() {
            var obj = new Object();
            obj.Value = $("#hdSelRecObjectKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/DocRecObjectChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSelRecObjectKeys").val(returnValue);
                addRecObject();
            }
        }
        /*增加合发部门人员*/
        function addJoinDeptUser() {
            var returnValue = $("#hdSelJoinDeptUserKeys").val();
            var clienttxtChooseJoinDeptUserObj = ASPxClientButtonEdit.Cast("txtChooseJoinDeptUser");
            if (returnValue != "") {
                var treeModelList = JSON.parse(returnValue);
                var userString = "";
                for (var i = 0; i < treeModelList.length; i++) {
                    userString += treeModelList[i].Text + ",";
                }
                userString = userString.substr(0, userString.lastIndexOf(','));
                clienttxtChooseJoinDeptUserObj.SetValue(userString);
            }
            else {
                clienttxtChooseJoinDeptUserObj.SetValue("");
            }
        }
        /*选择合发部门人员*/
        function chooseJoinDeptUser() {
            var obj = new Object();
            obj.Value = $("#hdSelJoinDeptUserKeys").val()
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/JoinDeptUserChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSelJoinDeptUserKeys").val(returnValue);
                addJoinDeptUser();
            }
        }
        //图片预览
        function previewImg() {
            var clientlogoUploadObj = ASPxClientUploadControl.Cast("logoUpload");
            if (clientlogoUploadObj.GetText() != "") {
                var ip = new ImagePreview($$("logoUpload_TextBox0_Input"), $$("imgLogo"), {
                });
                ip.img.src = ImagePreview.TRANSPARENT;
                ip.preview();
                $("#imgLogo").css("display", "block");
            }
            else {
                $("#imgLogo").attr("src", "");
            }
            $('#imgLogo').css("height", "100px");
            $('#imgLogo').css("width", "100px");
        }
        /*缩略图*/
        function isPicNews_ValueChanged(s, e) {
            var clientFIsPicNewsObj = ASPxClientCheckBox.Cast(s);
            var clientcboThumbGenTypeObj = ASPxClientComboBox.Cast("cboThumbGenType");
            var clientchkTQTPDZObj = ASPxClientCheckBox.Cast("chkTQTPDZ");
            var clientFThumbSeqIDObj = ASPxClientTextBox.Cast("FThumbSeqID");
            var clientlogoUploadObj = ASPxClientUploadControl.Cast("logoUpload");
            if (clientFIsPicNewsObj.GetChecked()) {
                clientcboThumbGenTypeObj.SetEnabled(true);
                clientchkTQTPDZObj.SetEnabled(true);
                clientchkTQTPDZObj.SetChecked(true);
                clientFThumbSeqIDObj.SetEnabled(true);
                if (clientFThumbSeqIDObj.GetValue() == null || clientFThumbSeqIDObj.GetValue() == "") {
                    clientFThumbSeqIDObj.SetValue("1");
                }

            }
            else {
                clientcboThumbGenTypeObj.SetEnabled(false);
                clientchkTQTPDZObj.SetEnabled(false);
                clientFThumbSeqIDObj.SetEnabled(false);
                clientlogoUploadObj.ClearText();
                clientlogoUploadObj.RemoveFileInput(0);
                clientcboThumbGenTypeObj.SetValue("1");
                clientchkTQTPDZObj.SetChecked(false);
                clientFThumbSeqIDObj.SetText("");
                $("#imgLogo").attr("src", "");
                $("#imgLogo").css("display", "none");
            }

        }
        /*选择缩略图产生方式*/
        function cboThumbGenType_ValueChanged() {
            var clientchkSLTObj = ASPxClientCheckBox.Cast("chkSLT");
            if (clientchkSLTObj.GetChecked()) {
                var clientcboThumbGenTypeObj = ASPxClientComboBox.Cast("cboThumbGenType");
                var clientchkTQTPDZObj = ASPxClientCheckBox.Cast("chkTQTPDZ");
                var clientFThumbSeqIDObj = ASPxClientTextBox.Cast("FThumbSeqID");
                var clientlogoUploadObj = ASPxClientUploadControl.Cast("logoUpload");
                if (clientcboThumbGenTypeObj.GetValue() == "1" || clientcboThumbGenTypeObj.GetValue() == "2") {
                    clientchkTQTPDZObj.SetChecked(true);
                    clientFThumbSeqIDObj.SetEnabled(true);
                    clientlogoUploadObj.ClearText();
                    clientlogoUploadObj.RemoveFileInput(0);
                    if (clientFThumbSeqIDObj.GetValue() == null || clientFThumbSeqIDObj.GetValue() == "") {
                        clientFThumbSeqIDObj.SetValue("1");
                    }
                    clientchkTQTPDZObj.SetEnabled(true);
                    $("#imgLogo").attr("src", "");
                    $("#imgLogo").css("display", "none");
                }
                else {
                    clientchkTQTPDZObj.SetChecked(false);
                    clientFThumbSeqIDObj.SetEnabled(false);
                    clientFThumbSeqIDObj.SetText("");
                    if (clientlogoUploadObj.GetFileInputCount() == 0) {
                        clientlogoUploadObj.AddFileInput();
                    }

                    clientchkTQTPDZObj.SetEnabled(false);

                }
            }

        }
        /*选择提取图片地址*/
        function chkTQTPDZ_ValueChanged() {
            var clientchkTQTPDZObj = ASPxClientCheckBox.Cast("chkTQTPDZ");
            var clientFThumbSeqIDObj = ASPxClientTextBox.Cast("FThumbSeqID");
            if (clientchkTQTPDZObj.GetChecked()) {
                clientFThumbSeqIDObj.SetEnabled(true);
                if (clientFThumbSeqIDObj.GetValue() == null || clientFThumbSeqIDObj.GetValue() == "") {
                    clientFThumbSeqIDObj.SetValue("1");
                }
            }
            else {
                clientFThumbSeqIDObj.SetText("");
                clientFThumbSeqIDObj.SetEnabled(false);
            }
        }
        /*判断选择的图片是否正确*/
        function pdPath(xh) {
            var t = 0;
            var r = /^[0-9]*[1-9][0-9]*$/  //正整数
            if (!r.test(xh)) {
                return -2;
            }

            var imgcount = 0;
            var oEditor = FCKeditorAPI.GetInstance("fck1");
            var fckvalue = oEditor.GetXHTML(true);
            t = fckvalue.indexOf("<img");
            while (t != -1) {
                imgcount = imgcount + 1;
                if (imgcount != xh) {
                    t = fckvalue.indexOf("<img", t + 1);
                }
                else {
                    var tlast = fckvalue.indexOf("/>", t);
                    var imgurl = fckvalue.substr(t, tlast + 2 - t); //选择的图片路径
                    var intSrc = imgurl.indexOf("src=\"");
                    var intSrc1 = imgurl.indexOf("\"", intSrc + 5);
                    var strSrc = imgurl.substr(intSrc + 5, intSrc1 - intSrc - 5); //缩略图原图路径"/publish/01/..."
                    document.getElementById("hdSltYLJ").value = strSrc;  //把缩略图路径保存到隐藏域
                    break;
                }
            }

            return t;
        }
        function fThumbSeqID_LostFocus() {
            var clientFThumbSeqIDObj = ASPxClientTextBox.Cast("FThumbSeqID");
            var imgCount = clientFThumbSeqIDObj.GetText();

            var len1 = $('#pic_list1').children('li').length; //已保存的图片数量
            var len2 = $('#pic_list').children('li').length; //上传图片数量
            var len = len1 + len2;
            if (len > 0) {
                if (len < imgCount) {
                    alert("无该序号的图片!");
                    clientFThumbSeqIDObj.SetText("");
                }
            }
            else {
                var t = pdPath(imgCount);
                if (t == -1) {
                    alert("无该序号的图片!");
                    clientFThumbSeqIDObj.SetText("");
                }
            }
        }
        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnSave":
                    {
                        //保存
                        save()
                        break;
                    }
                case "btnCancel":
                    {
                        //取消
                        var docClsCd = $("#hdGridDocClsCd").val();
                        var pageIndex = $("#hdPageIndex").val();
                        switch ($("#hdDocType").val()) {
                            case "PUB":
                                {
                                    window.location.href = rootPath + "/Admin/DocumentPub/DocumentList?docClsCd=" + docClsCd + "&pageIndex=" + pageIndex;
                                    break;
                                }
                            case "MANAGE":
                                {
                                    window.location.href = rootPath + "/Admin/DocumentManage/DocumentList?docClsCd=" + docClsCd + "&pageIndex=" + pageIndex;
                                    break;
                                }
                            case "AUDIT":
                                {
                                    window.location.href = rootPath + "/Admin/DocumentAudit/DocumentList?docClsCd=" + docClsCd + "&pageIndex=" + pageIndex;
                                    break;
                                }

                        }

                        break;
                    }
            }
        }
        /*保存*/
        function save() {
            var isCtlAllValid = true;
            var errorText = "";
            ASPxClientEdit.ValidateEditorsInContainer(null);
            var clientFTitleObj = ASPxClientTextBox.Cast("FTitle");
            if (!clientFTitleObj.GetIsValid()) {
                isCtlAllValid = false;
                errorText += clientFTitleObj.GetErrorText() + "\n";
            }
            var clientchkTQTPDZObj = ASPxClientCheckBox.Cast("chkTQTPDZ");
            var clientFThumbSeqIDObj = ASPxClientTextBox.Cast("FThumbSeqID");
            if (clientchkTQTPDZObj.GetChecked()) {
                if (!clientFThumbSeqIDObj.GetIsValid()) {
                    isCtlAllValid = false;
                    errorText += clientFThumbSeqIDObj.GetErrorText() + "\n";
                }
                else {
                    var imgCount = clientFThumbSeqIDObj.GetText();


                    var len1 = $('#pic_list1').children('li').length; //已保存的图片数量
                    var len2 = $('#pic_list').children('li').length; //上传图片数量
                    var len = len1 + len2;
                    if (len > 0) {
                        if (len < imgCount) {
                            alert("无该序号的图片!");
                            clientFThumbSeqIDObj.SetText("");
                            errorText += clientFTitleObj.GetErrorText() + "\n";
                            isCtlAllValid = false;
                        }
                    }
                    else {
                        var t = pdPath(imgCount);

                        if (t == -1) {
                            alert("无该序号的图片!");
                            clientFThumbSeqIDObj.SetText("");
                            errorText += clientFTitleObj.GetErrorText() + "\n";
                            isCtlAllValid = false;
                        }

                    }
                }
            }
            if (isCtlAllValid) {
                var clientrdEditModeObj = ASPxClientRadioButtonList.Cast("rdEditMode");
                var editModeValue = clientrdEditModeObj.GetValue();
                if (editModeValue == "0") {
                    //HTML
                    //为了解决编辑器内容提交比较慢
                    var oFCKeditor = FCKeditorAPI.GetInstance("fck1");
                    var fckValue = oFCKeditor.GetXHTML(true);
                    fckValue = fckValue.replace(new RegExp("　", "gm"), "&nbsp;&nbsp;&nbsp;&nbsp;");
                    $("#hdfckValue").val(fckValue);

                   // $("#hdfckValue").val(oFCKeditor.GetXHTML(true));
                }

                lpModal.Show();
                if (editModeValue == "0") {
                    form1.submit();
                }
                else {
                    saveFileToUrlDOC(clientFTitleObj.GetText());
                }

            }
            else {
                alert(errorText);
            }
        }

        /*信息文档呈送*/
        function addDocReference() {
            var returnValue = $("#hdDocReferenceCls").val();
            var clienttxtChooseDocClsObj = ASPxClientButtonEdit.Cast("txtChooseDocCls");
            if (returnValue != "") {
                var treeModelList = JSON.parse(returnValue);
                var userString = "";
                for (var i = 0; i < treeModelList.length; i++) {
                    userString += treeModelList[i].Text + ",";
                }
                userString = userString.substr(0, userString.lastIndexOf(','));
                clienttxtChooseDocClsObj.SetValue(userString);
            }
            else {
                clienttxtChooseDocClsObj.SetValue("");
            }
        }
        /*选择信息类别*/
        function chooseDocCls() {
            var entryModel = $("#hdDocReferenceCls").val();

            var obj = new Object();
            if (entryModel != "") {
                obj.Value = entryModel;
            }
            else {
                obj.Value = "";
            }
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/DocReferenceClsChoose", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                var treeModelList = JSON.parse(returnValue);
                $("#hdDocReferenceCls").val(JSON.stringify(treeModelList));
                var showText = "";
                for (var i = 0; i < treeModelList.length; i++) {
                    showText += treeModelList[i].Text + ",";
                }
                if (showText != "") {
                    showText = showText.substring(0, showText.lastIndexOf(','));
                }
                var txtVal = ASPxClientButtonEdit.Cast("txtChooseDocCls");

                txtVal.SetText(showText);
            }

        }

        /*调整TabGroup*/
        function resizeTabGroup() {
            //var clienttabCtlGroupObj = ASPxClientPageControl.Cast("tabCtlGroup");
            //clienttabCtlGroupObj.AdjustSize();
        }

        /*部门删除
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function delDeptRow(tableId, rowId, typeString) {
            $("#" + tableId + " tr").remove("tr[id='" + rowId + "']");
            var treeModelList = JSON.parse($("#hdSel" + typeString + "DeptKeys").val());
            for (var i = 0; i < treeModelList.length; i++) {
                if (rowId == ("tr_" + typeString + "Dept" + treeModelList[i].Value)) {
                    treeModelList.splice(i, 1);
                    break;
                }
            }
            $("#hdSel" + typeString + "DeptKeys").val(JSON.stringify(treeModelList));
        }
        /*工作组删除
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function delWorkGroupRow(tableId, rowId, typeString) {
            $("#" + tableId + " tr").remove("tr[id='" + rowId + "']");
            var treeModelList = JSON.parse($("#hdSel" + typeString + "WorkGroupKeys").val());
            for (var i = 0; i < treeModelList.length; i++) {
                if (rowId == ("tr_" + typeString + "WrokGroup" + treeModelList[i].Value)) {
                    treeModelList.splice(i, 1);
                    break;
                }
            }
            $("#hdSel" + typeString + "WorkGroupKeys").val(JSON.stringify(treeModelList));
        }
        /*岗位删除
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function delPositionRow(tableId, rowId, typeString) {
            $("#" + tableId + " tr").remove("tr[id='" + rowId + "']");
            var treeModelList = JSON.parse($("#hdSel" + typeString + "PositionKeys").val());
            for (var i = 0; i < treeModelList.length; i++) {
                if (rowId == ("tr_" + typeString + "Position" + treeModelList[i].Value)) {
                    treeModelList.splice(i, 1);
                    break;
                }
            }
            $("#hdSel" + typeString + "PositionKeys").val(JSON.stringify(treeModelList));
        }

        /*部门表格增加*/
        function addRowBm_table(typeString) {
            var returnValue = $("#hdSel" + typeString + "DeptKeys").val();
            if (returnValue != "") {
                var tableName = "table" + typeString + "BM";
                var treeModelList = JSON.parse(returnValue);
                for (var i = 0; i < treeModelList.length; i++) {
                    var isExisits = false;
                    $("#" + tableName + " tr").each(function () {
                        if (this.id == ("tr_" + typeString + "Dept" + treeModelList[i].Value)) {
                            isExisits = true;
                            return;
                        }
                    });
                    if (!isExisits) {
                        //添加
                        var rowId = "tr_" + typeString + "Dept" + treeModelList[i].Value;
                        var ddl = treeModelList[i].Text;
                        var ddlJbName = "cbo_" + typeString + "Dept" + treeModelList[i].Value;
                        $("#" + tableName).append("<tr id='" + rowId + "'><td class='tdClass' align='center'><img src='" + rootPath + "/Content/images/delete.gif' width='9' height='9' style='cursor:pointer' onclick=delDeptRow('" + tableName + "','" + rowId + "','" + typeString + "') /></td><td  class='tdClass'  align='center'>" + ddl + "</td><td class='tdClass' align='center'><select id='" + ddlJbName + "' name='" + ddlJbName + "'><option value='1'>正级</option><option value='2'>副级</option><option value='3'>正副级</option><option value='9' selected>任何人</option></select></td></tr>");
                        var propJsonString = $("#hdSel" + typeString + "DeptPropKeys").val();
                        if (propJsonString != "") {
                            var propList = JSON.parse(propJsonString);
                            for (var j = 0; j < propList.length; j++) {
                                if (propList[j].Value == treeModelList[i].Value) {
                                    $("#" + ddlJbName).val(propList[j].Text);
                                    break;
                                }
                            }
                        }
                    }
                }
                var removeTrIdArray = new Array();
                $("#" + tableName + " tr").each(function () {
                    var isExisits = false;
                    for (var i = 0; i < treeModelList.length; i++) {
                        if (this.id == ("tr_" + typeString + "Dept" + treeModelList[i].Value)) {
                            isExisits = true;
                            break;
                        }
                    }
                    if (!isExisits) {
                        removeTrIdArray.push(this.id);
                    }
                });
                for (var i = 0; i < removeTrIdArray.length; i++) {
                    $("#" + tableName + " tr").remove("tr[id='" + removeTrIdArray[i] + "']");
                }
            }

        }

        /*部门增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addRowBm(typeString) {
            var obj = new Object();
            obj.Value = $("#hdSel" + typeString + "DeptKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/DeptChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSel" + typeString + "DeptKeys").val(returnValue);
                addRowBm_table(typeString);
            }
        }

        /*工作组表格增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addRowGZZ_table(typeString) {
            var returnValue = $("#hdSel" + typeString + "WorkGroupKeys").val();
            if (returnValue != "") {
                var tableName = "table" + typeString + "GZZ";
                var treeModelList = JSON.parse(returnValue);
                for (var i = 0; i < treeModelList.length; i++) {
                    var isExisits = false;
                    $("#" + tableName + " tr").each(function () {
                        if (this.id == ("tr_" + typeString + "WrokGroup" + treeModelList[i].Value)) {
                            isExisits = true;
                            return;
                        }
                    });
                    if (!isExisits) {
                        //添加
                        var rowId = "tr_" + typeString + "WrokGroup" + treeModelList[i].Value;
                        var ddl = treeModelList[i].Text;
                        var ddlJbName = "cbo_" + typeString + "WrokGroup" + treeModelList[i].Value;
                        $("#" + tableName).append("<tr id='" + rowId + "'><td class='tdClass' align='center'><img src='" + rootPath + "/Content/images/delete.gif' width='9' height='9' style='cursor:pointer' onclick=delWorkGroupRow('" + tableName + "','" + rowId + "','" + typeString + "') /></td><td  class='tdClass'  align='center'>" + ddl + "</td><td class='tdClass' align='center'><select id='" + ddlJbName + "' name='" + ddlJbName + "'><option value='1'>正级</option><option value='2'>副级</option><option value='3'>正副级</option><option value='9' selected>任何人</option></select></td></tr>");

                        var propJsonString = $("#hdSel" + typeString + "WorkGroupPropKeys").val();
                        if (propJsonString != "") {
                            var propList = JSON.parse(propJsonString);
                            for (var j = 0; j < propList.length; j++) {
                                if (propList[j].Value == treeModelList[i].Value) {
                                    $("#" + ddlJbName).val(propList[j].Text);
                                    break;
                                }
                            }
                        }
                    }
                }
                var removeTrIdArray = new Array();
                $("#" + tableName + " tr").each(function () {
                    var isExisits = false;
                    for (var i = 0; i < treeModelList.length; i++) {
                        if (this.id == ("tr_" + typeString + "WrokGroup" + treeModelList[i].Value)) {
                            isExisits = true;
                            break;
                        }
                    }
                    if (!isExisits) {
                        removeTrIdArray.push(this.id);
                    }
                });
                for (var i = 0; i < removeTrIdArray.length; i++) {
                    $("#" + tableName + " tr").remove("tr[id='" + removeTrIdArray[i] + "']");
                }
            }
        }
        /*工作组增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addRowGZZ(typeString) {
            var obj = new Object();
            obj.Value = $("#hdSel" + typeString + "WorkGroupKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/WorkGroupChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSel" + typeString + "WorkGroupKeys").val(returnValue);
                addRowGZZ_table(typeString);
            }
        }

        /*岗位表格增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addRowGW_table(typeString) {
            var returnValue = $("#hdSel" + typeString + "PositionKeys").val();
            if (returnValue != "") {
                var tableName = "table" + typeString + "GW";
                var treeModelList = JSON.parse(returnValue);
                for (var i = 0; i < treeModelList.length; i++) {
                    var isExisits = false;
                    $("#" + tableName + " tr").each(function () {
                        if (this.id == ("tr_" + typeString + "Position" + treeModelList[i].Value)) {
                            isExisits = true;
                            return;
                        }
                    });
                    if (!isExisits) {
                        //添加
                        var rowId = "tr_" + typeString + "Position" + treeModelList[i].Value;
                        var ddl = treeModelList[i].Text;
                        $("#" + tableName).append("<tr id='" + rowId + "'><td class='tdClass' align='center'><img src='" + rootPath + "/Content/images/delete.gif' width='9' height='9' style='cursor:pointer' onclick=delPositionRow('" + tableName + "','" + rowId + "','" + typeString + "') /></td><td  class='tdClass'  align='center'>" + ddl + "</td></tr>");

                    }
                }
                var removeTrIdArray = new Array();
                $("#" + tableName + " tr").each(function () {
                    var isExisits = false;
                    for (var i = 0; i < treeModelList.length; i++) {
                        if (this.id == ("tr_" + typeString + "Position" + treeModelList[i].Value)) {
                            isExisits = true;
                            break;
                        }
                    }
                    if (!isExisits) {
                        removeTrIdArray.push(this.id);
                    }
                });
                for (var i = 0; i < removeTrIdArray.length; i++) {
                    $("#" + tableName + " tr").remove("tr[id='" + removeTrIdArray[i] + "']");
                }
            }
        }
        /*岗位增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addRowGW(typeString) {
            var obj = new Object();
            obj.Value = $("#hdSel" + typeString + "PositionKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/PositionChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSel" + typeString + "PositionKeys").val(returnValue);

                addRowGW_table(typeString);
            }
        }
        /*用户组增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addGroup(typeString) {
            var returnValue = $("#hdSel" + typeString + "GroupKeys").val();
            if (returnValue != "") {
                var treeModelList = JSON.parse(returnValue);
                var clienttxtYHZObj = ASPxClientButtonEdit.Cast("txt" + typeString + "YHZ");
                var yhzString = "";
                for (var i = 0; i < treeModelList.length; i++) {
                    yhzString += treeModelList[i].Text + ",";
                }
                yhzString = yhzString.substr(0, yhzString.lastIndexOf(','));
                clienttxtYHZObj.SetValue(yhzString);
            }
        }
        /*选择用户组
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chooseGroup(typeString) {
            var obj = new Object();
            obj.Value = $("#hdSel" + typeString + "GroupKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/UserGroupChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSel" + typeString + "GroupKeys").val(returnValue);
                addGroup(typeString);
            }

        }
        /*用户增加
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function addUser(typeString) {
            var returnValue = $("#hdSel" + typeString + "UserKeys").val();
            if (returnValue != "") {
                var treeModelList = JSON.parse(returnValue);
                var clienttxtUserObj = ASPxClientButtonEdit.Cast("txt" + typeString + "User");
                var userString = "";
                for (var i = 0; i < treeModelList.length; i++) {
                    userString += treeModelList[i].Text + ",";
                }
                userString = userString.substr(0, userString.lastIndexOf(','));
                clienttxtUserObj.SetValue(userString);
            }
        }

        /*选择用户
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chooseUser(typeString) {
            var obj = new Object();
            obj.Value = $("#hdSel" + typeString + "UserKeys").val();
            var returnValue = window.showModalDialog(rootPath + "/Admin/Dialog/EmpChooseTree", obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (returnValue) != "undefined") {
                $("#hdSel" + typeString + "UserKeys").val(returnValue);
                addUser(typeString);
            }

        }

        /*权限点击全局
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkRHR_ValueChanged(typeString) {
            var clientchkRHRObj = ASPxClientCheckBox.Cast("chk" + typeString + "RHR");
            var clientchkQJObj = ASPxClientCheckBox.Cast("chk" + typeString + "QJ");
            if (clientchkRHRObj.GetChecked()) {
                $("#table" + typeString).css("display", "none");
                $("#tableQJ" + typeString).css("display", "none");
            }
            else {
                $("#tableQJ" + typeString).css("display", "block")
                if (clientchkQJObj.GetChecked()) {
                    $("#table" + typeString).css("display", "none");
                }
                else {
                    $("#table" + typeString).css("display", "block");
                }
            }
        }

        /*点击发起部门
        Manage-维护 Audit-审核 Look-查看
        */
        function chkFQBM_ValueChanged(chkName, cboName) {
            var clientchkFQBMObj = ASPxClientCheckBox.Cast(chkName);
            var clientcboFQBMObj = ASPxClientComboBox.Cast(cboName);
            if (clientchkFQBMObj.GetChecked()) {
                clientcboFQBMObj.SetEnabled(true);
            }
            else {
                clientcboFQBMObj.SetEnabled(false);
            }
        }

        /*权限点击全局
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkQJ_ValueChanged(typeString) {
            var clientchkRHRObj = ASPxClientCheckBox.Cast("chk" + typeString + "RHR");
            var clientchkQJObj = ASPxClientCheckBox.Cast("chk" + typeString + "QJ");
            if (!clientchkRHRObj.GetChecked()) {
                if (clientchkQJObj.GetChecked()) {
                    $("#table" + typeString).css("display", "none");
                }
                else {
                    $("#table" + typeString).css("display", "block");
                }
            }
        }

        /*权限指定部门
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkBM_ValueChanged(typeString) {
            var clientchkBMObj = ASPxClientCheckBox.Cast("chk" + typeString + "BM");
            if (clientchkBMObj.GetChecked()) {
                $("#table" + typeString + "BM").css("display", "block");
            }
            else {
                $("#table" + typeString + "BM").css("display", "none");
            }
        }
        /*权限指定工作组
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkGZZ_ValueChanged(typeString) {
            var clientchkGZZObj = ASPxClientCheckBox.Cast("chk" + typeString + "GZZ");
            if (clientchkGZZObj.GetChecked()) {
                $("#table" + typeString + "GZZ").css("display", "block");
            }
            else {
                $("#table" + typeString + "GZZ").css("display", "none");
            }
            resizeTabGroup();
        }
        /*权限指定岗位
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkGW_ValueChanged(typeString) {
            var clientchkGWObj = ASPxClientCheckBox.Cast("chk" + typeString + "GW");
            if (clientchkGWObj.GetChecked()) {
                $("#table" + typeString + "GW").css("display", "block");
            }
            else {
                $("#table" + typeString + "GW").css("display", "none");
            }
            resizeTabGroup();
        }
        /*权限指定用户组
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkYHZ_ValueChanged(typeString) {
            var clientchkYHZObj = ASPxClientCheckBox.Cast("chk" + typeString + "YHZ");
            var clienttxtYHZObj = ASPxClientButtonEdit.Cast("txt" + typeString + "YHZ");
            if (clientchkYHZObj.GetChecked()) {
                clienttxtYHZObj.SetEnabled(true);
            }
            else {
                clienttxtYHZObj.SetEnabled(false);
                clienttxtYHZObj.SetValue("");
                $("#hdSel" + typeString + "GroupKeys").val("");
            }
        }
        /*权限指定人员
        Pub-发布 Manage-维护 Audit-审核 Look-查看
        */
        function chkUser_ValueChanged(typeString) {
            var clientchkUserObj = ASPxClientCheckBox.Cast("chk" + typeString + "User");
            var clienttxtUserObj = ASPxClientButtonEdit.Cast("txt" + typeString + "User");
            if (clientchkUserObj.GetChecked()) {
                clienttxtUserObj.SetEnabled(true);
            }
            else {
                clienttxtUserObj.SetEnabled(false);
                clienttxtUserObj.SetValue("");
                $("#hdSel" + typeString + "UserKeys").val("");
            }
        }
    </script>

    <script type="text/javascript">
        var swfu;
        window.onload = function () {
            swfu = new SWFUpload({
                // Backend Settings
                upload_url: rootPath + "/Admin/DocumentPub/Upload",
                post_params: {
                //                    "ASPSESSID": "<%=Session.SessionID %>"
            },

            // File Upload Settings
            file_size_limit: "100 MB",
            file_types: "*.jpg;*.jpeg",
            file_types_description: "JPG Images",
            file_upload_limit: "0",    // Zero means unlimited

            // Event Handler Settings - these functions as defined in Handlers.js
            //  The handlers are not part of SWFUpload but are part of my website and control how
            //  my website reacts to the SWFUpload events.
            file_queue_error_handler: fileQueueError,
            file_dialog_complete_handler: fileDialogComplete,
            upload_progress_handler: uploadProgress,
            upload_error_handler: uploadError,
            upload_success_handler: uploadSuccess,
            upload_complete_handler: uploadComplete,

            // Button settings
            button_image_url: rootPath + "/Scripts/SWFUpload/images/XPButtonNoText_160x22.png",
            button_placeholder_id: "spanButtonPlaceholder",
            button_width: 80,
            button_height: 26,
            button_text: '',
            button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 17.5px; }',
            button_text_top_padding: 8,
            button_text_left_padding: 5,

            // Flash Settings
            flash_url: rootPath + "/Scripts/SWFUpload/swf/swfupload.swf", // Relative to this file

            custom_settings: {
                upload_target: "divFileProgressContainer"
            },
            // Debug Settings
            debug: false
        });
    }


    function clearNoNum(obj) {
        //先把非数字的都替换掉，除了数字和.
        obj.value = obj.value.replace(/[^\d.]/g, "");
        //必须保证第一个为数字而不是.
        obj.value = obj.value.replace(/^\./g, "");
        //保证只有出现一个.而没有多个.
        obj.value = obj.value.replace(/\.{2,}/g, ".");
        //保证.只出现一次，而不能出现两次以上
        obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
        if (obj.value == "") {
            obj.value = 0;
        }
    }
    function DelPic(id) {
        if (confirm("确定删除吗?")) {
            $.ajax({
                type: 'POST',
                url: rootPath + '/Admin/DocumentPub/DelPic',
                data: { id: id },
                success: function (result) {
                    if (result == "ok") {
                        $('#overPic').find('#pic_' + id).remove();
                        if ($('#overPic').find('ul').html() == '') {
                            $('#overPic').remove();
                        }
                    } else if (result == "error") {
                        alert("删除失败!");
                    } else {
                        alert("删除参数错误!");
                    }
                }
            });
        }
    }

    </script>

</head>
@helper  ReturnBoolValue(int value)
    {
        if (value == 1)
        {
    @:block
        }
        else
        {
    @:none
        }
}
@helper  ReturnBoolValue(string value)
    {
        if (value == "Y" || value == "AUDIT")
        {
    @:block
        }
        else
        {
    @:none
        }
}
@helper  ReturnBoolValuePUB(string value)
    {
        if (value == "PUB")
        {
    @:block
        }
        else
        {
    @:none
        }
}
<body>
    @using (Html.BeginForm("Save", "DocumentPub", FormMethod.Post, new { id = "form1", enctype = "multipart/form-data", @class = "tableFrom" }))
    {
        <div class="floatToolMenu" id="toolMenu" style="z-index: 99;">
            <iframe style="position: absolute; visibility: inherit; top: 0px; left: 0px; width: 100%;
                height: 28px; z-index: -1; background-color: #00CCFF; border-width: 0px; filter='progid:dximagetransform.microsoft.alpha(style=0,opacity=0)';">
            </iframe>
            @Html.DevExpress().Menu(settings =>
       {
           settings.Name = "toolBarMenu";
           settings.ItemAutoWidth = false;
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
           settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
           settings.Items.Add(item =>
           {
               item.Name = "btnSave";
               item.Text = "保存";
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/filesave.png");

           });
           settings.Items.Add(item =>
           {
               item.Name = "btnCancel";
               item.Text = "取消";
               item.ItemStyle.ForeColor = System.Drawing.Color.Red;
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/cancel.png");

           });
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
           settings.ItemLinkMode = ItemLinkMode.ContentBounds;
       }).GetHtml()
        </div>
        <table align="center" class="tableForm">
            <tr>
                <th style="width: 15%">
                    <font color='red'>*</font>@Html.DevExpress().Label(settings => { settings.Text = "信息标题:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FTitle";
                   settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Text = Model.DocumentModel.FTitle;
                   settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyValidation(s,e,'信息标题')}";
                   settings.Properties.ValidationSettings.SetFocusOnError = true;
                   settings.Properties.ValidationSettings.Display = Display.Dynamic;
               }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(Model.DocClsModel.FUseSubTitle)">
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "副标题:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FSubTitle";
                   settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Text = Model.DocumentModel.FSubTitle;
               }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(Model.DocClsModel.FIsReferenceNo)">
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "文号:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FReferenceNo";
                   settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Text = Model.DocumentModel.FReferenceNo;
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "作者:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FAuthor";
                   settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Text = Model.DocumentModel.FAuthor;
               }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(Model.DocClsModel.FIsRecObject)">
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "通知对象:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().ButtonEdit(settings =>
               {
                   settings.Name = "txtChooseUser";
                   settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.ReadOnly = true;
                   //settings.Text = ViewData["FEmpName"].ToString(); ;
                   settings.Properties.Buttons.Add("选择");
                   settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseRecObject()}";
                   //settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyValidation(s,e,'对应员工')}";
               }).GetHtml()
                </td>
            </tr>
             <tr style="display:@ReturnBoolValuePUB(ViewData["docType"].ToString())">
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "呈送栏目:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().ButtonEdit(settings =>
               {
                   settings.Name = "txtChooseDocCls";
                   settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.ReadOnly = true;
                   settings.Properties.Buttons.Add("选择");
                   settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseDocCls()}";

               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "编辑模式:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().RadioButtonList(settings =>
               {
                   settings.Name = "rdEditMode";
                   settings.Properties.RepeatLayout = System.Web.UI.WebControls.RepeatLayout.Flow;
                   settings.Properties.RepeatDirection = System.Web.UI.WebControls.RepeatDirection.Horizontal;
                   settings.Properties.Style.Border.BorderWidth = 0;
                   settings.Properties.RepeatColumns = 4;
                   settings.Properties.ClientSideEvents.Init = "function(s,e){rdEditMode_ValueChanged(s,e,'Y')}";
                   settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){rdEditMode_ValueChanged(s,e)}";
               }).BindList(ViewData["editModeSelection"] as List<SelectListItem>).Bind(ViewData["defaultEditMode"]).GetHtml()
                </td>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "模板:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FDocTemplate";

                            settings.Width = 120;
                            settings.Properties.RenderIFrameForPopupElements = DefaultBoolean.True;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.EnableClientSideAPI = true;
                            settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){FDocTemplate_ValueChanged(s,e)}";

                        }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(Model.DocClsModel.FIsShowHomePageCtrl)">
                <th style="width: 15%">
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsShowHomePage";
                        settings.Checked = Model.DocumentModel.FIsShowHomePage == "Y" ? true : false;
                        settings.ClientVisible = Model.DocClsModel.FIsShowHomePageCtrl == "Y" ? true : false;
                        settings.Text = "在首页中显示";

                    }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(ViewData["isTop"].ToString())">
                <th style="width: 15%">
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsTop";
                        settings.Checked = Model.DocumentModel.FIsTop == 1 ? true : false;
                        settings.Text = "置顶";

                    }).GetHtml()
                </td>
            </tr>
  

            @{
               if (Model.DocClsModel.FIsNotice == "Y")
               {
                    @Html.Raw("<tr><th style=\"width: 15%\"></th><td style=\"width: 85%\" class=\"tdClass\" colspan=\"3\">")
                    @Html.Raw("<table cellpadding='0' cellspacing='0' border='0'><tr>")                                                                                                        
                    @Html.Raw("<td>")
                    @Html.DevExpress().CheckBox(
                        settings =>
                        {
                            settings.Name = "IsToFinancePlat";
                            settings.Checked = Model.DocumentModel.IsToFinancePlat == "Y" ? true : false;
                            settings.Text = "推送到财政服务平台";

                        }).GetHtml()
                    @Html.Raw("</td>")
                    @Html.Raw("<td>")
                    @Html.DevExpress().CheckBox(
                        settings =>
                        {
                            settings.Name = "IsToIntranetPlat";
                            settings.Checked = Model.DocumentModel.IsToIntranetPlat == "Y" ? true : false;
                            settings.Text = "在内网中显示";

                        }).GetHtml()
                    @Html.Raw("</td></tr></table>")
                    @Html.Raw("</td></tr>")
               }
               
               bool isShowPubJCMS = false;
               if (Model.DocClsModel.FIsPubJCMS == "Y")
               {

                   if (Model.DocClsModel.FIsNeedAudit == "N")
                   {
                       isShowPubJCMS = true;
                   }
                   else
                   {
                       if (Model.DocClsModel.FIsNeedAudit == "Y" && ViewData["docType"].ToString() == "AUDIT")
                       {
                           isShowPubJCMS = true;
                       }
                   }
                   if (isShowPubJCMS)
                   {
                <tr>
                    <th style="width: 15%">
                    </th>
                    <td style="width: 85%" class="tdClass" colspan="3">
                        @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsPubJCMS";
                        //settings.Checked = Model.DocumentModel.FIsPubJCMS == "Y" ? true : false;
                        if (Model.DocumentModel.FIsPubJCMS == "Y")
                        {
                            settings.Text = "已推送到JCMS,点击勾选,再次推送";
                            settings.ControlStyle.ForeColor = System.Drawing.Color.Red;
                        }
                        else
                        {
                            settings.Text = "推送到JCMS(外网)";
                        }

                    }).GetHtml()
                    </td>
                </tr>
                   }
               }
            }

            <tr style="display:@ReturnBoolValue(Model.DocClsModel.FIsHomePageShowLimit)">
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "有效期至:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().DateEdit(settings =>
               {
                   settings.Name = "FValidDate";
                   settings.Properties.NullText = "";
                   settings.Properties.DisplayFormatString = "yyyy-MM-dd";
                   settings.Properties.EditFormatString = "yyyy-MM-dd";
                   if (ViewData["serverTime"] != null)
                   {
                       settings.Properties.MinDate = DateTime.Parse(ViewData["serverTime"].ToString());
                   }
                   settings.Properties.RenderIFrameForPopupElements = DefaultBoolean.True;
                   if (Model.DocumentModel.FValidDate.HasValue)
                   {
                       settings.Date = Model.DocumentModel.FValidDate.Value;
                   }

               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "发布部门:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    <table>
                        <tr>
                            <td>
                                @Html.DevExpress().RadioButtonList(settings =>
                           {
                               settings.Name = "rdPubDept";
                               settings.Properties.RepeatLayout = System.Web.UI.WebControls.RepeatLayout.Flow;
                               settings.Properties.RepeatDirection = System.Web.UI.WebControls.RepeatDirection.Horizontal;
                               settings.Properties.Style.Border.BorderWidth = 0;
                               settings.Properties.RepeatColumns = 2;
                               settings.ControlStyle.CssClass = "left";
                               settings.Properties.ClientSideEvents.Init = "function(s,e){rdPubDept_ValueChanged(s,e)}";
                               settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){rdPubDept_ValueChanged(s,e)}";
                               settings.ClientEnabled = (bool)ViewData["isChooseDept"];
                           }).BindList(ViewData["pubItemSelection"] as List<SelectListItem>).Bind(ViewData["defaulRadioChooseValue"]).GetHtml()
                            </td>
                            <td>
                                @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "cboPubDept";

                            settings.Width = 200;
                            settings.Properties.RenderIFrameForPopupElements = DefaultBoolean.True;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.EnableClientSideAPI = true;
                            settings.ClientVisible = false;
                            settings.ControlStyle.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Bottom;
                            settings.ClientEnabled = (bool)ViewData["isChooseDept"];
                            //settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){FDocTemplate_ValueChanged(s,e)}";

                        }).BindList(ViewData["docPubDeptSelection"] as List<SelectListItem>).Bind(ViewData["defaultPubDept"]).GetHtml()
                                @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "cboPubWorkGroup";

                            settings.Width = 200;
                            settings.Properties.RenderIFrameForPopupElements = DefaultBoolean.True;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.EnableClientSideAPI = true;
                            settings.ClientVisible = false;
                            settings.ControlStyle.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Bottom;
                            settings.ClientEnabled = (bool)ViewData["isChooseDept"];
                            //settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){FDocTemplate_ValueChanged(s,e)}";

                        }).BindList(ViewData["docPubWorkGroupSelection"] as List<SelectListItem>).Bind(ViewData["defaultPubWorkGroup"]).GetHtml()
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "合发部门:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().ButtonEdit(settings =>
               {
                   settings.Name = "txtChooseJoinDeptUser";
                   settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.ReadOnly = true;
                   //settings.Text = ViewData["FEmpName"].ToString(); ;
                   settings.Properties.Buttons.Add("选择");
                   settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseJoinDeptUser()}";
                   //settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyValidation(s,e,'对应员工')}";
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "发布人:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().Label(settings => { settings.Text = Model.DocumentModel.FEmpName; }).GetHtml()
                </td>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "发布时间:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().Label(settings => { settings.Text = Model.DocumentModel.FPubDate.ToString("yyyy-MM-dd"); }).GetHtml()
                </td>
            </tr>
             <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "落款:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FDownTitle";
                   settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
               }).Bind(Model.DocumentModel.FDownTitle).GetHtml()
                </td>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "落款日期:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FDownDateString";
                   settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
               }).Bind(Model.DocumentModel.FDownDateString).GetHtml()
                </td>
            </tr>
        </table>
       
        <div id="divFck" style="display: none">
            @Html.TextArea("fck1", Model.DocumentModel.FContentTxt, new { @cols = "30", @rows = "10" })
        </div>
       if (Model.DocClsModel.FEditMode == "A" || Model.DocClsModel.FEditMode == "O")
       {
        @Html.Partial("OfficeControlPartial")
       }
    
       
       if (ViewData["viewStr"] != null && ViewData["viewStr"].ToString() != "")
        { 
            @Html.Raw(ViewData["viewStr"].ToString())
        }
       <fieldset style="display:@ReturnBoolValue((int)Model.DocClsModel.FIsPicNews)">
            <legend style="font-size: 12px">
                上传图片
            </legend>
            <table class="tableForm">
                <tr>
                    <td>
                        <div id="swfu_container" style="margin: 0px 10px;">
		                    <div>
				                <span id="spanButtonPlaceholder"></span>
		                    </div>
		                    <div id="divFileProgressContainer" style="height:75px;display:none;"></div>
		                    <div id="thumbnails"></div>
                            <ul id="pic_list" style="margin:5px;">
                        
                            </ul>                   
	                    </div>            
                    </td>
                </tr>
            </table>
                  
       </fieldset>
       
        <fieldset style="display:@ReturnBoolValue((int)Model.DocClsModel.FIsPicNews)">
            <legend style="font-size: 12px">
                @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkSLT";
                        if (ViewData["hdMethod"] != null && ViewData["hdMethod"].ToString() != "EDIT")
                        {
                            //新增
                            if (Model.DocClsModel.FIsPicNews == 1)
                            {
                                settings.Checked = true;//新增默认图片缩率图勾上
                            }
                        }
                        else
                        {
                            settings.Checked = !string.IsNullOrEmpty(Model.DocumentModel.FThumbSrvFileName) ? true : false;
                        }
                        settings.Text = "缩略图";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){isPicNews_ValueChanged(s,e)}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){isPicNews_ValueChanged(s,e)}";
                    }).GetHtml()
            </legend>
            <table class="tableForm">
                <tr>
                    <th style="width: 35%">
                        @Html.DevExpress().Label(settings => { settings.Text = "缩略图产生方式:"; }).GetHtml()
                    </th>
                    <td style="width: 15%" class="tdClass">
                        @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "cboThumbGenType";

                            settings.Width = 150;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.ClientSideEvents.Init = "function(s,e){cboThumbGenType_ValueChanged(s,e)}";
                            settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){cboThumbGenType_ValueChanged(s,e)}";
                        }).BindList(ViewData["ThumbGenTypeSelection"]).Bind(Model.DocumentModel.FThumbGenType).GetHtml()
                    </td>
                    <td style="width: 50%" class="tdClass" colspan="2">
                        <table>
                            <tr>
                                <td>
                                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkTQTPDZ";
                        //settings.Checked = Model.DocClsModel == 1 ? true : false;
                        settings.Text = "提取图片地址";
                        //settings.Properties.ClientSideEvents.Init = "function(s,e){isPicNews_ValueChanged(s,e)}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkTQTPDZ_ValueChanged(s,e)}";
                    }).GetHtml()
                                </td>
                                <td>
                                    @Html.DevExpress().Label(settings => { settings.Text = "第"; }).GetHtml()
                                </td>
                                <td>
                                    @Html.DevExpress().TextBox(settings =>
                               {
                                   settings.Name = "FThumbSeqID";
                                   settings.Width = 30;
                                   settings.ClientEnabled = false;
                                   settings.Text = Model.DocumentModel.FThumbSeqID.HasValue ? Model.DocumentModel.FThumbSeqID.Value.ToString() : "";
                                   settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyAndIntValidation(s,e,'提取图片地址')}";
                                   settings.Properties.ClientSideEvents.LostFocus = "function(s,e){fThumbSeqID_LostFocus(s,e)}";
                               }).GetHtml()
                                </td>
                                <td>
                                    @Html.DevExpress().Label(settings => { settings.Text = "张"; }).GetHtml()
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <th style="width: 35%">
                        @Html.DevExpress().Label(settings => { settings.Text = "自定义缩略图:"; }).GetHtml()
                    </th>
                    <td style="width: 15%" class="tdClass" colspan="3">
                        @Html.DevExpress().UploadControl(
                            settings =>
                            {
                                settings.Name = "logoUpload";
                                settings.BrowseButton.Text = "浏览";
                                settings.ClearFileSelectionImage.ToolTip = "清除选择";
                                settings.ShowProgressPanel = false;
                                settings.ValidationSettings.Assign(ElingOA6_Admin_DSJCJ.Common.UploadControlHelper.PicValidationSettings);
                                settings.ShowUploadButton = false;
                                settings.ClientSideEvents.TextChanged = "function(s,e){previewImg()}";
                            }).GetHtml()
                    </td>
                </tr>
                <tr>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "图片预览:"; }).GetHtml()
                    </th>
                    <td style="width: 35%" class="tdClass" colspan="3">
                        <img id="imgLogo" src="@Model.DocumentModel.FThumbSrvFileName"  width="100px" height="100px" />
                    </td>
                </tr>
            </table>
        </fieldset>
        <table class="tableForm" style="display:@ReturnBoolValue(ViewData["docType"].ToString())">
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "录用状态:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().RadioButtonList(settings =>
               {
                   settings.Name = "FIsEnroll";
                   settings.Properties.RepeatLayout = System.Web.UI.WebControls.RepeatLayout.Flow;
                   settings.Properties.RepeatDirection = System.Web.UI.WebControls.RepeatDirection.Horizontal;
                   settings.Properties.Style.Border.BorderWidth = 0;
                   settings.Properties.RepeatColumns = 3;
                   settings.ControlStyle.CssClass = "left";
               }).BindList(new List<SelectListItem>(){
                            new SelectListItem(){ Value="Y", Text="录用"} ,
                             new SelectListItem(){ Value="N", Text="未录用"},
                             new SelectListItem(){ Value="", Text="待审核"}, 
                                }).Bind(string.IsNullOrEmpty(Model.DocumentModel.FIsEnroll) ? "" : Model.DocumentModel.FIsEnroll).GetHtml()
                </td>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "审核人:"; }).GetHtml()
                </th>
                <td style="width: 50%" class="tdClass">
                    <table class="tableForm">
                        <tr>
                            <td style="width: 20%" class="tdClass">
                                @Html.DevExpress().Label(settings => { settings.Text = Model.DocumentModel.FAuditEmpName; }).GetHtml()
                            </td>
                            <th style="width: 20%">
                                @Html.DevExpress().Label(settings => { settings.Text = "审核时间:"; }).GetHtml()
                            </th>
                            <td style="width: 40%" class="tdClass">
                                @Html.DevExpress().Label(settings => { settings.Text = Model.DocumentModel.FAuditDate.HasValue ? Model.DocumentModel.FAuditDate.Value.ToString("yyyy-MM-dd HH:mm") : DateTime.Now.ToString("yyyy-MM-dd HH:mm"); }).GetHtml()
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <fieldset>
            <legend>附件</legend>
            <table id="tableOldAttach" border="0" cellpadding="0" cellspacing="0">
            </table>
            <table id="tableAttach" class="tableForm" border="0" cellpadding="0" cellspacing="0">
                <tr id="trAttach1" name='trAttach'>
                    <td style="width: 10%; text-align: right">
                        <a href="###" style="color: Red; font-size: 12px" onclick="delFileControl(1)">[删除]</a>
                    </td>
                    <td style="width: 30%">
                        @Html.DevExpress().UploadControl(
                            settings =>
                            {
                                settings.Name = "uploadName1";
                                settings.BrowseButton.Text = "浏览";
                                settings.ClearFileSelectionImage.ToolTip = "清除选择";
                                settings.ShowProgressPanel = false;
                                //settings.ValidationSettings.Assign(ElingOA6_Admin_DSJCJ.Common.UploadControlHelper.PicValidationSettings);
                                settings.ShowUploadButton = false;
                                settings.Width = 220;
                                settings.ClientSideEvents.TextChanged = "function(s,e){addFileControl(1)}";
                            }).GetHtml()
                    </td>
                    <td style="width: 60%">
                        说明<input type="text" style="width: 70%" name="fileDesc" />
                    </td>
                </tr>
            </table>
        </fieldset>
        
        <div id="tabs" class="div" style="display: none">
            <ul>
                @*<li id="liLookTab" style="display: none"><a href="#LookTab">查看权限</a></li>*@
                <li id="liLookTab"><a href="#LookTab">查看权限</a></li>
            </ul>
            <div id="LookTab">
                @Html.Partial("DocumentLookPartial")
            </div>
        </div>
        
        @Html.Hidden("hdjsAlert", ViewData["jsAlert"]);//错误信息
        @Html.Hidden("hdMethod", ViewData["hdMethod"]);
        @Html.Hidden("hdDocId", Model.DocumentModel.FDocId);                                              
        @Html.Hidden("hdDocClsCd", Model.DocClsModel.FDocClsCd);
        @Html.Hidden("hdGridDocClsCd", ViewData["gridDocClsCd"]);//表格传递的栏目编号
        @Html.Hidden("hdTemplateDefaultValue", ViewData["templateDefaultVlaue"]);
        @Html.Hidden("hdSelRecObjectKeys", ViewData["recObjectKeys"] == null ? "" : ViewData["recObjectKeys"].ToString());//通知对象
        @Html.Hidden("hdSelJoinDeptUserKeys", ViewData["joinDeptUserKeys"] == null ? "" : ViewData["joinDeptUserKeys"].ToString());//合发单位人员
        @Html.Hidden("hdfckValue", ""); //编辑器内容 
        @Html.Hidden("hdSltYLJ", ""); //缩略图路径 
        @Html.Hidden("hdEditMode", Model.DocumentModel.FEditMode); //编辑模式 H,O 
        @Html.Hidden("hdWaterMarkType", Model.DocClsModel.FIsPicWaterMark == 0 ? "" : Model.DocClsModel.FWaterMarkCls);
        @Html.Hidden("hdAttachJsonString", ViewData["attachJsonString"]);//信息附件显示 
        @Html.Hidden("hdNewofficetype", ViewData["defaultEditMode"] == null ? "" : ViewData["defaultEditMode"].ToString()); //office文件路径   
        @Html.Hidden("hdUrl", ViewData["url"] == null ? "" : ViewData["url"].ToString()); //office文件路径
        @Html.Hidden("hdDocType", ViewData["docType"]);//文档类型  PUB MANAGE AUDIT
        @Html.Hidden("hdShowLookTab", ViewData["showLookTab"]);//是否显示查看权限 Y,N
                                                     
        @Html.Hidden("hdUploadCtl", @Html.Partial("UploadControlPartial").ToHtmlString());//上传控件html
        @Html.Hidden("hdPageIndex", ViewData["pageIndex"] == null ? 1 : int.Parse(ViewData["pageIndex"].ToString()));//当前页      
        @Html.Hidden("FEmplNo", Model.DocumentModel.FEmplNo); //发布人ID                                                                                                                         
        @Html.Hidden("hdDocReferenceCls", ViewData["docReferenceClsJson"] == null ? "" : ViewData["docReferenceClsJson"].ToString());
                                                                                                                                    
        @Html.Partial("DocumentHiddenDeptPartial")
        @Html.Partial("DocumentHiddenWorkGroupPartial")
        @Html.Partial("DocumentHiddenPositionPartial")
        @Html.Partial("DocumentHiddenGroupPartial")
        @Html.Partial("DocumentHiddenUserPartial")
                                                                                                                                    
                    
                                                                                                                                    
                                                                                                                                                                                                                                                    
    }
</body>
</html>
